package com.smart.manager.member.entities.views;

import com.smart.common.entities.core.BaseView;
import com.smart.manager.product.entities.enums.PigStatus;
import com.smart.manager.product.entities.views.BasicPigstyView;
import com.smart.manager.product.entities.views.PigLevelView;
import io.ebean.annotation.View;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * @author Leo
 * @date 2023/10/09
 */
@Data
@Entity
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@View(name = "member_material_pig")
public class MemberPigView extends BaseView {


    @ApiModelProperty("猪仔ID")
    @Id
    private Long id;

    @ApiModelProperty("猪仔代码")
    private String code;

    @ApiModelProperty("猪仔名称")
    private String name;

    @ApiModelProperty("所属猪圈")
    @ManyToOne
    @JoinColumn(name = "pigsty",referencedColumnName = "code")
    private BasicPigstyView pigsty;

    @ApiModelProperty("猪仔详情")
    @ManyToOne
    @JoinColumn(name = "pig_level",referencedColumnName = "id")
    private PigLevelView pigLevel;

    @ApiModelProperty("所属玩家")
    @ManyToOne
    @JoinColumn(name = "member" , referencedColumnName = "id")
    private MemberView member;

    @ApiModelProperty("猪仔状态")
    private PigStatus status;

}
